package com.dim.list_orders;

import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class preferences extends PreferenceActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(com.dim.list_orders.R.xml.preferences);
		PreferenceManager.setDefaultValues(preferences.this,
				com.dim.list_orders.R.xml.preferences, true);
		
		
		Preference filtr_it_t = (Preference)findPreference("filtr_it_t");
		filtr_it_t.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
		                public boolean onPreferenceClick(Preference arg0) { 
		                	Intent i = new Intent(getBaseContext(), filtr.class);
		        			i.putExtra("table", "items_type");
		        			startActivity(i);
		                    return true;
		                }
		            });
		
		Preference filtr_st = (Preference)findPreference("filtr_st");
		filtr_st.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
		                public boolean onPreferenceClick(Preference arg0) { 
		                	Intent i = new Intent(getBaseContext(), filtr.class);
		        			i.putExtra("table", "status");
		        			startActivity(i);
		                    return true;
		                }
		            });
		
		
	}

}
